package com.day03;


/**
 * 账户：
 * properties: 卡号、密码、余额
 * method: 存钱、取钱
 * 信用卡账户
 * 信用额度
 */
public class IheritDemo {
    public static void main(String[] args) {

    }

}

class Account {
    private String cardId;//卡号
    private int password;//密码
    private double balance;//余额

    /**
     * 存钱
     */
    public void saveMoney(double num) {
        balance += num;
    }

    /**
     * 取钱
     */
    public void drawMoney(double num) {
        balance -= num;
    }

    public Account() {
    }

    public Account(String cardId, int password, double balance) {
        super();
        this.cardId = cardId;
        this.password = password;
        this.balance = balance;
    }
}

class CreditCard extends Account {
    private double creditLimit;//信用额度

//    public CreditCard() { }

    public CreditCard(String cardId, int password, double balance, double creditLimit) {
        super(cardId, password, balance);
        this.creditLimit = creditLimit;
    }
}
